import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const originaPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originaPush.call(this, location).catch(err => err)
}

const routes = [
    {
        path: '/',
        redirect: '/commandDispatch',
        component: () => import('@/views/index'),
        children: [
            {
                path: 'commandDispatch',
                name: 'commandDispatch',
                component: () => import('../components/commandDispatch')
            },
            {
                path: 'onepicture',
                name: 'onepicture',
                component:()=>import('../components/onepicture')
            }
        ]
    },
    {
        path:'/text',
        name:'text',
        component:()=>import('@/views/test')
    }
]
const router = new VueRouter({
    routes
})
export default router